Skip to content

Apply staticanalysis.RemoveUnused*#10964

Closed
Pankraz76 wants to merge 5 commits intojenkinsci:masterfrom
Pankraz76:rw-RemoveUnused
Closed

Apply staticanalysis.RemoveUnused*#10964
Pankraz76 wants to merge 5 commits intojenkinsci:masterfrom
Pankraz76:rw-RemoveUnused

Conversation

@Pankraz76
Copy link

@Pankraz76 Pankraz76 commented Aug 13, 2025

apply:

See JENKINS-XXXXX.

Testing done

Proposed changelog entries

  • human-readable text

Proposed changelog category

/label

Proposed upgrade guidelines

N/A

Submitter checklist

  • The Jira issue, if it exists, is well-described.
  • The changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developers, depending on the change) and are in the imperative mood (see examples). Fill in the Proposed upgrade guidelines section only if there are breaking changes or changes that may require extra steps from users during upgrade.
  • There is automated testing or an explanation as to why this change has no tests.
  • New public classes, fields, and methods are annotated with @Restricted or have @since TODO Javadocs, as appropriate.
  • New deprecations are annotated with @Deprecated(since = "TODO") or @Deprecated(forRemoval = true, since = "TODO"), if applicable.
  • New or substantially changed JavaScript is not defined inline and does not call eval to ease future introduction of Content Security Policy (CSP) directives (see documentation).
  • For dependency updates, there are links to external changelogs and, if possible, full differentials.
  • For new APIs and extension points, there is a link to at least one consumer.

Desired reviewers

@mention

Before the changes are marked as ready-for-merge:

Maintainer checklist

  • There are at least two (2) approvals for the pull request and no outstanding requests for change.
  • Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
  • Changelog entries in the pull request title and/or Proposed changelog entries are accurate, human-readable, and in the imperative mood.
  • Proper changelog labels are set so that the changelog can be generated automatically.
  • If the change needs additional upgrade steps from users, the upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the pull request title (see example).
  • If it would make sense to backport the change to LTS, a Jira issue must exist, be a Bug or Improvement, and be labeled as lts-candidate to be considered (see query).

@github-actions
Copy link
Contributor

Missing required label for changelog. Requires at least 1 of: bug, developer, dependencies, internal, localization, major-bug, major-rfe, rfe, regression-fix, removed, skip-changelog. Found: .

You can add the required label by adding a comment with the following text: /label <category>

Comment on lines -240 to -241
// JEP-200 whitelist changes prevent this field (and thus instances of this class) from being serialized.
private ClassLoader cl = InvalidNode.class.getClassLoader();
Copy link
Member

@daniel-beck daniel-beck Aug 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed to pass the tests in this class. It's not unused, it (intentionally) breaks the serialization, hence the class name and comment.

Comment on lines -61 to -63
// just to suppress warnings
private transient String charset, useSsl;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Introduced in 526c788 to not have warnings during deserialization.

Probably reasonable to remove at this point, but only because of age.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

considered obsolete right from the beginning. Perfect example what this project needs. @NotMyFault

Therefore treaded as Technical depth.

use or loose.

You can use silly PMD to fix it all manually or just apply rewrite to get auto fixes. PMD could still benefit as no tool is perfect.

Copy link
Member

@daniel-beck daniel-beck Aug 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

considered obsolete right from the beginning. Perfect example what this project needs.

The behavior of the software changes depending on whether this field is defined or not. If the fields did not exist, administrators are shown warnings from deserialization (in this case of backward-compatibility supporting code), usually indicative of a configuration issue close to data loss. These fields existing prevents that.

So if you think this project needs less backwards compatibility and more administrator confusion, you're exactly right.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These fields existing prevents that.

Did not know that, right. Thanks for explaining to me. Then need simple ignore for this case, as its important.

@Pankraz76
Copy link
Author

first need to fix current project setup:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants